import { Options } from './../../../utils/cache/index';
import { FormSchema } from '/@/components/Table';
export const accessoriesData: any = [
  {
    id: 1,
    name: '电梯',
    type: '1',
    icon: ['https://picsum.photos/id/66/346/216'],
    status: 1,
  },
];

export const accessoriesFormSchema: FormSchema[] = [
  {
    label: 'id',
    field: 'id',
    component: 'Input',
    show: false,
  },
  {
    field: 'name',
    label: '设备名称：',
    component: 'Input',
    colProps: { span: 22 },
  },
  {
    field: 'type',
    label: '所属类别：',
    required: true,
    component: 'Select',
    colProps: { span: 22 },
    rules: [
      {
        required: true,
        message: '请选择所属类别',
      },
    ],
    componentProps: {
      options: [
        {
          label: '业主配套特点',
          value: '0',
        },
        {
          label: '房屋配置特点',
          value: '1',
        },
      ],
    },
  },
  {
    label: '小图标',
    field: 'icon',
    component: 'Upload',
    slot: 'coverUrlSlot',
    rules: [
      {
        required: true,
        validator: async (_rule, value) => {
          if (!value) {
            /* eslint-disable-next-line */
            return Promise.reject('请添加小图标');
          }
          return Promise.resolve();
        },
        trigger: 'change',
      },
    ],
  },
];
